package com.itheima.api;

import java.util.ArrayList;

public class Studenttest {
    public static void main(String[] args) {

        Student student = new Student("张三", 19);
        Student student1 = new Student("张三", 19);
        System.out.println(student);
        System.out.println(student==student1);//false
        System.out.println(student.equals(student1));//true
        ArrayList<Student> list=new ArrayList<>();
        list.add(student);
//        list.add(student1);
        System.out.println(student.equals(list));//false
        System.out.println(student.equals(null));//false
    }
}
